package com.ymttest.database.sqlwapper.shenqisettlement;

import java.util.List;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.shenqisettlement.GoodsOwnerSettlementConfig;

public class GoodsOwnerSettlementConfigWrapper {

	SqlManager manager;

    public GoodsOwnerSettlementConfigWrapper() {
        manager = new SqlManager("shenqisettlement");
    }
    
    @SuppressWarnings("unchecked")
	public GoodsOwnerSettlementConfig selectByPrimaryKey(Long id) {
    	    	
		List<GoodsOwnerSettlementConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.GoodsOwnerSettlementConfigMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() == 0) {
			Logger.comment("goods_owner_settlement_config没有数据");

			return null;
		}

		return result.get(0);
	}
    
    @SuppressWarnings("unchecked")
	public GoodsOwnerSettlementConfig selectByMerchantId(Long merchantId) {
    	
    	List<GoodsOwnerSettlementConfig> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.shenqisettlement.GoodsOwnerSettlementConfigMapper.selectByMerchantId",
                        merchantId);
        manager.commit();
        
		if (result.size() == 0) {
			Logger.comment("mch_fee_config没有数据");
			
			return null;
		}
		
		return result.get(0);
    }
  
    public static void main(String[] args) {
    	
    	GoodsOwnerSettlementConfigWrapper test = new GoodsOwnerSettlementConfigWrapper();
    	
    	System.out.println(test.selectByMerchantId(501861591L));
    }
}
